import { createRouter, createWebHistory } from 'vue-router'
import Login from '../views/login/login.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/login',
      name: 'Login',
      component: Login,
    },
    {
      path: '/admin',
      name: 'AdminLayout',
      // component: () => import('../views/admin/layout.vue'),
      redirect: '/admin/user',
      children: [
        {
          path: 'user',
          name: 'AdminUser',
          component: () => import('../views/admin/user.vue'),
        },
        {
          path: 'employee',
          name: 'AdminEmployee',
          component: () => import('../views/admin/employee.vue'),
        },
        {
          path: 'medicine',
          name: 'AdminMedicine',
          component: () => import('../views/admin/medicine.vue'),
        },
        {
          path: 'category',
          name: 'AdminCategory',
          component: () => import('../views/admin/category.vue'),
        },
        {
          path: 'stock',
          name: 'AdminStock',
          component: () => import('../views/admin/stock.vue'),
        },
        {
          path: 'FooterCom',
          name: 'FooterCom',
          component: () => import('../components/FooterCom.vue'),
        },
        {
          path: 'Header',
          name: 'Header',
          component: () => import('../components/Header.vue'),
        },
      ],
    },
  ],
})

export default router
